/******************************************************************************
 * @File name   :      UsrgrpApplication.java
 *
 * @Author      :      Frank
 *
 * @Date        :      2011-6-3 8:57:19
 *
 * @Copyright Notice: 
 * Copyright (c) 2014 DMS, Inc. All  Rights Reserved.
 * This software is published under the terms of the DMS Software
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file.
 * 
 * 
 * ----------------------------------------------------------------------------
 * Date                   Who         Version        Comments
 * 2011-6-3 8:57:19       Frank     1.0            Initial Version
 *****************************************************************************/
package com.cap.bts.framework.dm.approval.domain;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.cap.bts.framework.approvalrule.domain.BaseApplication;
import com.cap.bts.framework.usermgnt.domain.EmployeeInfo;

/**
 * user group application domain
 */
@Entity
@Table(name = "TT_DM_USER_GROUP_APP")
@AttributeOverrides( {
        @AttributeOverride(name = "createDate", column = @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "DATE DEFAULT SYSDATE")),
        @AttributeOverride(name = "createBy", column = @Column(name = "CREATE_BY", nullable = false, columnDefinition = "number(18) default 0")),
        @AttributeOverride(name = "lastUpdateBy", column = @Column(name = "LAST_UPDATE_BY", nullable = false, columnDefinition = "number(18) default 0")),
        @AttributeOverride(name = "lastUpdateDate", column = @Column(name = "LAST_UPDATE_DATE", nullable = false, columnDefinition = "DATE DEFAULT SYSDATE")),
        @AttributeOverride(name = "brandId", column = @Column(name = "BRAND_ID", nullable = false, columnDefinition = "number(1) default 0")),
        @AttributeOverride(name = "approvalCategory", column = @Column(name = "APPROVAL_CATEGORY", nullable = false, columnDefinition = "number(18) default 0")),
        @AttributeOverride(name = "approvalResult", column = @Column(name = "APPROVAL_RESULT", nullable = false, columnDefinition = "number(1) default 0")),
        @AttributeOverride(name = "approvalState", column = @Column(name = "APPROVAL_STATE", nullable = false, columnDefinition = "number(1) default 0")) })
public class UserGroupApplication extends BaseApplication {

    private static final long serialVersionUID = 4072815654508907519L;

    private Long id;
//    private long brandId;
//    private long userGroupId;
    private String usrgrpCode;

    private EmployeeInfo employeeInfo;
    private long dealerOrgId;
//    private int usrGrpApprovalCategory;
//    private int nextStep;
//    private int result;
    private int operationType;
    
    private String  orgCode;
    
    private String srcGrpCode;
    
    /**
     * Constructor
     * @Date        :      2011-7-22
     * @param category  app category
     */
    public UserGroupApplication(long brandId, int category) {
        super(brandId, category);
    }
    
    public UserGroupApplication() {
        super();
    }

    /**
     * @Date        :      2011-7-1
     *
     * @return the orgCode
     */
    @Column(name = "ORG_CODE")
    public String getOrgCode() {
        return orgCode;
    }

    /**
     * @Date        :      2011-7-1
     *
     * @param orgCode the orgCode to set
     */
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }

    /**
     * @Date        :      2011-6-27
     *
     * @return the usrgrpCode
     */
    @Column(name = "USER_GROUP_CODE")
    public String getUsrgrpCode() {
        return usrgrpCode;
    }

    /**
     * @Date        :      2011-6-27
     *
     * @param usrgrpCode the usrgrpCode to set
     */
    public void setUsrgrpCode(String usrgrpCode) {
        this.usrgrpCode = usrgrpCode;
    }
    /**
     * @Date        :      2011-6-9
     *
     * @return the operationType
     */
    @Column(name = "OPERATION_TYPE", nullable = false)
    public int getOperationType() {
        return operationType;
    }

    /**
     * @Date        :      2011-6-9
     *
     * @param operationType the operationType to set
     */
    public void setOperationType(int operationType) {
        this.operationType = operationType;
    }

    /**
     * @Date        :      2011-6-9
     *
     * @return the dealerOrgId
     */
    @Column(name = "DEALER_ORG_ID", nullable = false)
    public long getDealerOrgId() {
        return dealerOrgId;
    }

    /**
     * @Date        :      2011-6-9
     *
     * @param dealerOrgId the dealerOrgId to set
     */
    public void setDealerOrgId(long dealerOrgId) {
        this.dealerOrgId = dealerOrgId;
    }

    /**
     * @Date        :      2011-6-8
     *
     * @return the employeeInfo
     */
    @ManyToOne(targetEntity = EmployeeInfo.class, fetch = FetchType.LAZY)
    @JoinColumn(name = "EMPLOYEE_ID", referencedColumnName = "id")
    public EmployeeInfo getEmployeeInfo() {
        return employeeInfo;
    }

    /**
     * @Date        :      2011-6-8
     *
     * @param employeeInfo the employeeInfo to set
     */
    public void setEmployeeInfo(EmployeeInfo employeeInfo) {
        this.employeeInfo = employeeInfo;
    }

    /**
     * @Date : 2011-6-3 8:57:19
     * 
     * @return the id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    /**
     * @Date :2011-6-3 8:57:19
     * 
     * @param id
     *            the id to set
     */
    public void setId(Long pId) {
        this.id = pId;
    }

	public void setSrcGrpCode(String srcGrpCode) {
		this.srcGrpCode = srcGrpCode;
	}

	@Column(name = "SRC_USER_GROUP_CODE", nullable = false)
	public String getSrcGrpCode() {
		return srcGrpCode;
	}
    
    


    /**
     * @Date : 2011-6-7
     * 
     * @return the employeeId
     */
//    @Column(name = "EMPLOYEE_ID", nullable = false)
//    public long getEmployeeId() {
//        return employeeId;
//    }

    /**
     * @Date : 2011-6-7
     * 
     * @param employeeId
     *            the employeeId to set
     */
//    public void setEmployeeId(long employeeId) {
//        this.employeeId = employeeId;
//    }

   
}
